Create Assessment Task
Introduction
The following Assetic REST API endpoint may be used to create a new assessment task:
-
POST /api/v2/assessmenttask
Assessment Task Definition
When creating a new assessment task the following properties are relevant:
Property | Description | Type | Sample |
Name | The user-friendly name of the assessment task | String | "Name": "New Assessment Task API Example" |
ProjectId |
The unique identifier of an assessment project to link the assessment task to. Refer to the integration article Create Assessment Project for information on creating assessment projects using the Brightly Assetic REST API, in order to capture the assessment project's GUID during creation. |
GUID | "AsmtProjectId": "8d5f1e05-94bf-4c25-9627-18c1e4133915" |
Status |
The current status of the assessment task. "Open" (300) "Completed" (500) |
String | "Status": "Open" |
RsResourceIdAssignedTo |
An object containing an "Id" property with the Assetic GUID of the resource that is assigned to the assessment task. See the Get Resources article for additional information on retrieving resource details. |
Object | "RsResourceIdAssignedTo": {"Id": "1a0497f6-31dd-e611-946c-06edd62954d7"} |
StartDate | The date the assessment begins. | DateTime | "StartDate": "2023-01-01T00:00:00" |
EndDate | The date the assessment ends. | DateTime | "EndDate": "2023-01-31T23:59:99" |
Comments |
General comments for the assessment task. 4000 character limit. |
String | "Comments": "Example Comment" |
ExternalIdentifier | A reference to an external identifier. | String | "ExternalIdentifier": "EXT15028" |
AsmtTaskForms |
An array of objects with Assessment Form properties, for configuring the Required Forms details of the assessment task. The array may contain 0, 1, or multiple form objects. See the Get Assessment Forms article for information on retrieving an assessment form's GUID. |
Array | "AsmtTaskForms": [ { "FormId": "cda32909-c018-4f77-8501-230b4252ce4d", "Minimum": 1, "Maximum": 5, "Order": 1}] |
TaskTypeId |
An identifier for the type of Task. Use TaskTypeId = '1'. |
Integer | "TaskTypeId": 1 |
AssetObject |
An object containing an "Id" property with the Assetic GUID of the asset that the assessment task is linked to. See the Retrieve Assets and associated records article for information on retrieving an asset's details. |
Object | "AssetObject": { "Id": "2e0f65d1-ffb0-4a38-9ba |
Sample Payload
The following is a typical payload used to create a new Assessment Task.
Sample Request
In this example request, an assessment task is created with two required assessment forms. Each form is configured with a minimum of 1 and a maximum of 5 form results required for the assessment.
{ "AsmtProjectId": "69d9562f-0be0-4c77-b9d9-70f7c75b1053", "Name": "Create Assessment Task API Example", "Status": "Open", "RsResourceIdAssignedTo": { "Id": "1a0497f6-31dd-e611-946c-06edd62954d7" }, "StartDate": "2023-01-01T00:00:00", "EndDate": "2023-01-31T00:00:00", "Comments": "This is a new assessment task.", "ExternalIdentifier": "EXT15028", "AsmtTaskForms": [ { "FormId": "8fb47019-9f75-e711-8187-025500ccdddb", "Minimum": 1, "Maximum": 5, "Order": 1 }, { "FormId": "b0e4fcbf-1d68-e611-9469-06edd62954d7", "Minimum": 1, "Maximum": 5, "Order": 2 } ], "TaskTypeId": 1, "AssetObject": { "Id": "932c55ae-ad33-4580-99da-005534065f68" } }
Sample Response
The response is returned as a collection and includes the generated unique GUID for the assessment task in the "Id" property of the response:
{ "Data": [ { "Id": "5fb71905-e2a7-4496-a9aa-50f5bdba0cab", "AsmtProjectId": "69d9562f-0be0-4c77-b9d9-70f7c75b1053", "Status": 300, "AssessmentLevel": 0, "RsResourceIdAssignedTo": { "Id": "1a0497f6-31dd-e611-946c-06edd62954d7", "DisplayName": null, "_links": [], "_embedded": null }, "Name": "Create Assessment Task API Example", "TaskId": "TASK016343", "StartDate": "2023-01-01T00:00:00", "EndDate": "2023-01-31T00:00:00", "CompletionDate": null, "Priority": 0, "ResultsCount": 0, "Comments": "This is a new assessment task.", "LastModified": "0001-01-01T11:00:00", "CreatedDateTime": null, "ExternalIdentifier": "EXT15028", "AsmtTaskForms": [ { "FormId": "8fb47019-9f75-e711-8187-025500ccdddb", "FormName": null, "FormLabel": null, "Minimum": 1, "Maximum": 5, "Order": 1, "FormVersion": 0, "FormResultCount": 0 }, { "FormId": "b0e4fcbf-1d68-e611-9469-06edd62954d7", "FormName": null, "FormLabel": null, "Minimum": 1, "Maximum": 5, "Order": 2, "FormVersion": 0, "FormResultCount": 0 } ], "TaskTypeId": 1, "AssetObject": { "Id": "932c55ae-ad33-4580-99da-005534065f68", "Name": null, "Label": null, "TypeLabel": null, "Type": 0, "LocationWkt": null }, "_links": [], "_embedded": null } ], "Total": 1 }